<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<include file="Public:meta" />
	<style>
		.type1{ color:black;}
		.type2{ color:red;}
		.type3{ color:green;}
		.type4{ color:blue;}
		.type5{ color:#600;}
		.type6{ color:#FF6600;}
		.type7{ color:#FF00FF;}
		.type15{ color:#999;}
		.InvoiceInfo{ cursor:pointer; color:#0000FF; padding-left:5px;}
		.InvoiceItem{display:none; background:#FFF;padding:8px; line-height:22px;text-align:left;border:1px solid #87A34D; color:blue;}
		.pt7{ color: #666;}
	</style>
</head>
<body id="main_page">
<include file="Public:position" />
<div class="container">
    <form enctype="multipart/form-data" method="post" id="frm">
    	<input type="hidden" name="NowPage" id="NowPage" value="{$NowPage}" />
        <div class="table">
           <div class="toolbars">
                <li class="toolbar"><a id="btnSaveAll" href="{$Url}add"  title="添加业绩信息" target="_self">添加业绩信息</a></li>
                <li class="toolbar"><a id="btnSaveAll" href="{$Url}batchAdd"  title="批量登记模板" target="_self">批量登记模板</a></li>
                <li class="toolbar toolbarform">
                    <label>客户</label>
                    <select name="CustomerID" id="CustomerID">
                        <option value="-1" selected="selected">全部客户</option>
                        <volist name="CustomerData" id="a">
                            <option value="{$a.MemberID}" <eq name="a.MemberID" value="$CustomerID">selected="selected"</eq> >
                                {$a.MemberID}&nbsp;&nbsp;{$a.MemberName}&nbsp;&nbsp;{$a.MemberRealName}
                                <neq name="a.MemberGroupID" value="101">&nbsp;&nbsp;{$a.MemberGroupName}</neq>
                            </option>
                        </volist>
                    </select>
                    <label>项目类型</label>
                    <select name="ProjectType" id="ProjectType">
                        <option value="-1">全部类型</option>
                        <volist name="Type" id="p">
                            <option value="{$p.ProjectTypeID}"  <eq name="p.ProjectTypeID" value="$ProjectType">selected="selected"</eq>>{$p.ProjectTypeName}</option>
                        </volist>
                    </select>
                    <label>时间</label>
                    <select name="Year" id="Year">
                        <option value="-1">全部年份</option>
                        <volist name="YearSpan" id="y">
                            <option value="{$y.Year}">{$y.Year}年</option>
                        </volist>
                    </select><select name="Month" id="Month">
                        <option value="-1">全部月份</option>
                        <for start="1" end="13">
                            <option value="{$i}">{$i}月</option>
                        </for>
                    </select>
                    <label>付款方式</label>
                    <select name="PayType" id="PayType">
                        <option value="-1">全部付款方式</option>
                        <volist name="PayType" id="pt">
                            <option value="{$pt.PayTypeID}"  <eq name="pt.PayTypeID" value="$PayTypeID">selected="selected"</eq>>{$pt.PayTypeName}</option>
                        </volist>
                    </select>
                    <label>是否开发票</label>
                    <select name="NeedInvoice" id="NeedInvoice">
                        <option value="-1">全部</option>
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select>
                    <input id="btnSeek" type="submit" value="查询" onclick="Search()">
                </li>
            </div>
            <table class="datatable" id="datatable">
                <tr>
                     <th width="45px" >序号</th>
                     <th width="190px" >项目名称</th>
                     <th width="65px" >项目类型</th> 
                     <th width="85px" >项目费用</th>
                     <th width="60px" >付款方式</th>
                     
                     <th width="190px" >客户名称</th>
                     <th width="90px" >是否购买授权</th>
                     <th>备注</th>
                     <th width="130px" >添加时间</th>
                     <th width="155px" >操作</th>
                </tr>  
                <notempty name="Data">
                <volist name="Data" id="d">
                    <tr>
                        <td>{$i}</td>
                        <td style="text-align:left;">
                            {$d.ProjectName}
                            <in name="d.ProjectType" value="1,7">
                                &nbsp;&nbsp;[<span style="color:blue">{$d.PcNumber}</span>
                                &nbsp;<span style="color:#F60">{$d.WapNumber}</span>]
                            </in>
                            <eq name="d.ProjectType" value="6">
                            &nbsp;&nbsp;[<span style="color:#F30; ">模板套数：{$d.TemplateCount}</span>]
                            </eq>
                        </td>
                        <td><b class="type{$d.ProjectType}">{$d.ProjectTypeName}</b></td>
                        <td style="color:red;"><span class="pt{$d.ProjectType}">￥</span><b class="pt{$d.ProjectType}">{$d.ProjectFee}</b>
                        <eq name="d.NeedInvoice" value="1">
                            <span  class="InvoiceInfo" rel="a{$d.PerformanceID}">[ 发票 ]</span>
                            <div class="InvoiceItem" id="a{$d.PerformanceID}">
                                <b>发票抬头</b>：{$d.InvoiceName}<br/>
                                <b>发票内容</b>：{$d.InvoiceContent}<br/>
                                <b>开票金额</b>：{$d.InvoiceMoney}<br/>
                                <b>收件人</b>：{$d.InvoiceConsignee}<br/>
                                <b>联系电话</b>：{$d.InvoiceTelephone}<br/>
                                <b>收件地址</b>：{$d.InvoiceAddress}<br/>
                                <b>发票备注</b>：{$d.InvoiceRemark}
                            </div>
                        </eq>
                        </td>
                        <td><notin name="d.ProjectType" value="7">{$d.PayTypeName}</notin></td>
                        <td>{$d.CustomerName}</td>
                        <td>
                        <in name="d.ProjectType" value="1,2">
                            <eq name="d.IsAuthorize" value="1">
                                <b style="color:green;">是</b>
                            <else/>
                                <b style="color:red;">否</b>
                            </eq>
                        </in>
                        </td>
                        <td style="text-align:left;">{$d.Remark}</td>
                        <td>{$d.AddTime|strtotime|yd_friend_date}</td>
                        <td class="operator">
                            <eq name="d.IsLock" value="0">
                                <a style="float:left" href="{$Url}Modify/id/{$d.PerformanceID}?CustomerID={$CustomerID}&ProjectType={$ProjectType}&Year={$Year}&Year={$Year}&Month={$Month}&NeedInvoice={$NeedInvoice}" id="btnEdit">修改</a>
                                <div class="btn-sep"></div>
                                <a style="float:left"  onclick="del({$d.PerformanceID})" class="btnDel">删除</a>
                            </eq>
                        </td>
                    </tr>
                </volist>
                        <tr>
                            <td colspan="3" style="text-align:right; padding-right:3px;font-weight:bold;color:#090;">总计：</td>
                            <td style="color:#090;">￥<b>{$TotalFee}</b></td>
                            <td colspan="6" style="text-align:left; padding-left:10px;">
                                <gt name="Percentage" value="0">
                                <b style="text-align:right; padding-right:3px;;color:#090;">
                                提成：{$TotalFeeExceptTemplate}&nbsp;&nbsp;x&nbsp;&nbsp;{$Percentage}&nbsp;&nbsp;=&nbsp;&nbsp;
                                <span style="color:red;">￥{$Money}</span></b>
                                </gt>
                              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                            <neq name="Think.post.CustomerID" value="-1">
                                <b>消费情况统计：</b>
                                <b style="color:green; margin-right:20px;">预存总金额：{$AgentFee}</b>
                                <b style="color:blue; margin-right:20px;">模板消费总金额：{$TemplateFee}</b>
                                <b style="color:red;">剩余总金额：{$LeftFee}</b>
                            </neq>
                            </td>
                        </tr>
                <else/>
                    <tr><td colspan="10" id="NoData">{$Think.lang.NoDataTip}</td></tr>
                </notempty>                                  
            </table>
             <div class="tfoot">
                  <div class="page"><span class="pagesize">每页<span class="pz">{$PageSize}</span>条</span>{$Page}</div>
             </div>
        </div>
    </form>
</div>
</body>
</html>
<script type="text/javascript">
function del(id){
	$.confirm("{$Think.lang.DeleteTip}", function () {
		var CustomerID = $("#CustomerID").val();
		var ProjectType = $("#ProjectType").val();
		var OperatorID = $("#OperatorID").val();
		var NowPage = "{$NowPage}";
		url = "{$Url}del/id/"+id+"/CustomerID/"+CustomerID+"/ProjectType/"+ProjectType+"/OperatorID/"+OperatorID+"/NowPage/"+NowPage;
		location.href = url;
	}, function () {
		return true;
	});
}

//查询
function Search(){
	$('#frm').attr("action", "{$Url}index");
	$('#frm').submit();
	return true;
}

$(document).ready(function() {
	 $("#Year").val( "{$Year}" ); 
	 $("#Month").val( "{$Month}" ); 
	 $("#NeedInvoice").val( "{$NeedInvoice}" ); 
	 $(".InvoiceInfo").powerFloat({
		reverseSharp:true,
		position:"2-1"
	});
});
</script>